<?php
namespace App\Http\Controllers\Admin;
use App\Models\Admin\TvmMobileDetail;
use App\Models\Admin\TvmMobileCategory;
use Illuminate\Support\Facades\DB;
use Illuminate\Http\Request;
use App\Models\Admin\AdminAction;


class CommentController extends CommonController {

	public function __construct()
	{
		parent::__construct();
		$this->checkLogin();
	}




	/**
	 * 评论列表
	 **/
	public function List(Request $request) {
		$sid = $_SESSION['admin_uid'];
		$condition = array();
		if($sid){
			$condition[] = ['sid', '=',$sid];
		}
		$list = Db::table('vassess')->where($condition)->orderBy('assess_time','desc')->paginate(15);
		return view('admin.comment.comment_list',[
			'data' => $list
		]);
	}


	/**
	 * @param Request $request
	 * 删除banner
	 */
	public function Del(Request $request){
		$id = $request->input('id');
		$result = DB::table('vassess')->where('id',$id)->delete();
		if($result){
			$this->ajax_success('删除成功',$result);
		}
		$this->ajax_error('删除失败',$result);
	}
	
}